package com.web709.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@ApiModel(value = "商品实体类")
public class Product {
    //商品id
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "商品id")
    private int id;
    //商品名
    @ApiModelProperty(value = "商品名")
    private String name;
    //商品图片
    @ApiModelProperty(value = "商品图片")
    private String img;
    //商品价格
    @ApiModelProperty(value = "商品价格")
    private String price;
    //商品详情
    @ApiModelProperty(value = "商品详情")
    private String detail;
    //商品库存
    @ApiModelProperty(value = "商品库存")
    private int stock;
    //商品销量
    @ApiModelProperty(value = "商品销量")
    private int sales;
    //商品状态
    @ApiModelProperty(value = "商品状态")
    private char status;
    //创建时间
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)//自动填充策略，在添加数据的时候自动填充
    private LocalDateTime createTime;
    //更新时间
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)//自动填充策略，在添加数据和修改数据的时候自动填充
    private LocalDateTime updateTime;
}
